package com.neuedu.mvc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

/**
 * 项目：      spring-framework
 * 类名:       StudentController
 * 创建时间：  2024/3/18 14：25
 * 描述 :
 * 作者 :     张金山
 * QQ :     314649444
 * Site:      https://jshand.gitee.io
 */
@Controller
@RequestMapping("/student")
public class StudentController {


    @RequestMapping("/list")
    public void list( HttpServletRequest request,  HttpServletResponse response) throws IOException {

        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");

        PrintWriter writer = response.getWriter();

        writer.write("<h1>列表项目 --学生</h1>");
        writer.flush();
        writer.close();
    }

    @RequestMapping("/save")
    public void save(HttpServletRequest request , HttpServletResponse response) throws IOException {
        PrintWriter writer = response.getWriter();
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        writer.write("<h1>列表项目 --学生</h1>");
        writer.flush();
        writer.close();
    }
}
